﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SST_BL;

namespace TCU
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        private string user = "";
        public bool IsAdmin = false;
        public bool IsCoordinador = false;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!MainBL.RevisarConexionBaseDatos())            
                Server.Transfer("NoConexion.aspx");            
            if(!IsPostBack){
                user = Request.ServerVariables["REMOTE_USER"].ToString();
                IsAdmin = MainBL.RevisarPermiso(user.Substring(user.IndexOf("\\") + 1), "Administrador");
                IsCoordinador = MainBL.IsCoordinadorTI(user.Substring(user.IndexOf("\\") + 1));
                notification.Text = "Bienvenido "+user.Substring(user.IndexOf("\\") + 1)+"!";                
            }

        }
    }
}
